<#import "/admin/_layout.html" as layout>
<@layout.header "用户"></@layout.header>
<@layout.body>
    <div class="content-header">
        <div class="container-fluid">
            <div class="row mb-2">
                <div class="col-sm-6">
                    <ol class="breadcrumb float-sm-left">
                        <li class="breadcrumb-item"><a href="#">用户</a></li>
                        <li class="breadcrumb-item active">列表</li>
                    </ol>
                </div>
            </div>
        </div>
    </div>

    <section class="content">
        <div class="container-fluid">
            <div class="row">
                <div class="col-12">
                    <div class="card">
                        <div class="card-header">

                            <form class="form-horizontal" action="/admin/user/list">
                                <div class="row">
                                    <div class="form-group row col-3">
                                        <label for="loginAccount" class="col-sm-3 col-form-label">账号</label>
                                        <div class="col-sm-9">
                                            <input type="text" class="form-control" id="loginAccount" name="loginAccount" value="${param('loginAccount')!}" placeholder="账号">
                                        </div>
                                    </div>
                                    <div class="form-group row col-3">
                                        <label for="loginAccount" class="col-sm-3 col-form-label">手机号</label>
                                        <div class="col-sm-9">
                                            <input type="text" class="form-control" id="phone" name="phone" value="${param('phone')!}" placeholder="手机号">
                                        </div>
                                    </div>
                                    <div class="form-group row col-3">
                                        <label for="inputPassword3" class="col-sm-4 col-form-label">状态</label>
                                        <div class="col-sm-8">
                                            <#assign _status=param('status')!""/>
                                            <select id="status" name="status" class="form-control">
                                                <option value="">全部</option>
                                                <option value="1" <@selectedIf value=(_status =="1")/>>启用</option>
                                                <option value="0" <@selectedIf value=(_status =="0")/>>停用</option>
                                            </select>
                                        </div>
                                    </div>
                                    <div class="form-group row col-3">
                                        <div class="col-sm-12">
                                            <button type="submit" class="btn btn-primary btn-sm">查询</button>
                                            <button type="reset" class="btn btn-default btn-sm">重置</button>
                                        </div>
                                    </div>
                                </div>

                            </form>

                        </div>

                        <div class="card-body">
                            <div class="row">
                                <a href="/admin/user/add" class="btn btn-info"><i class="fas fa-plus"></i> 新增</a>
                            </div>
                            <table class="table table-hover" style="width:100%">
                                <thead>
                                    <tr>
                                        <th>ID</th>
                                        <th>登录账号</th>
                                        <th>昵称</th>
                                        <th>手机</th>
                                        <th>最近登录时间</th>
                                        <th>状态</th>
                                        <th>来源</th>
                                        <th>操作</th>
                                    </tr>
                                </thead>
                                <#list pageData.records as item>
                                    <tr>
                                        <td>${item.id!}</td>
                                        <td>${(!item.loginAccount?? || item.loginAccount == "") ? string('无登录账号', item.loginAccount!'无登录账号') }</td>
                                        <td>${item.nickName!}</td>
                                        <td>${item.mobile!}</td>
                                        <td><@formatTime value=item.loginTime!/></td>
                                        <td><#if item.status == 1>启用<#else><font color="red">停用</font></#if></td>
                                        <td>${item.sourceStr!}</td>
                                        <td><a href="/admin/user/edit?id=${item.id!?c}">编辑</a></td>
                                    </tr>
                                </#list>
                            </table>
                            <@layout._adminPage/>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </section>
</@layout.body>
<@layout.script>
</@layout.script>